<!DOCTYPE html>
<?php 
//Do not change under here
require("bin/base.php");
?>

<html>
<head>
	<title>kulaNAS</title>
	<link rel="stylesheet" type="text/css" href="css/free-dash.css" />
	<link rel="stylesheet" type="text/css" href="css/progressbar.css" />
	<link rel="stylesheet" type="text/css" href="css/bgstretcher.css" />

	<script type="text/javascript" src="js/jquery17.min.js"></script>
	<script type="text/javascript" src="js/knockout-2.0.0.js"></script>
	<script type="text/javascript" src="js/knockout-mapping.js"></script>
	
	<script type="text/javascript" src="js/bgstretcher.js"></script>
	<script type="text/javascript" src="http://www.google.com/jsapi"></script>
		<script type="text/javascript">
			//google.load('visualization', '1', {packages: ['gauge']});
			//$("#sysinfo").load("bin/sysinfo.php");
			
			//Globals
			var sick_json;
			
			$(document).ready(function(){
			
				//  Initialize Backgound Stretcher
				$(document).bgStretcher({ 
					images: ['images/grunge.jpg'], imageWidth: 1600, imageHeight: 1200
				});
				
				setInterval(getSABNZDB,1000);	
			});	
		</script>
		
	<script type="text/javascript" src="js/core.js"></script>
</head>
<body>

 
<div id="page">

<div class="clear vspace"></div>

	<div class="sticker fullWidth">
		<div class="stickerHeading"><h1>Dashboard</h1></div>
		<div id="sysinfo"> </div>   
	</div>


	<div class="floatLeft" style="width:250px">
		<div class="sticker">
		<div class="stickerHeading" ><h1>Links</h1></div>
			
			<div class="content">
				<h1>Utils...</h1>
				<div id="Utils">
					<a href="http://<?php echo $ip;?>:8081/home/">Sick Beard</a><br/>
					<a href="http://<?php echo $ip . ':' . $couch_port;?>/movie/">Coach Potato</a><br/>
					<a href="http://<?php echo $ip;?>:8181">Headphones</a><br/>
					
					
				</div>

				<h1>Search...</h1>
				<div id="Utils">
					<a href="http://www.nzbmatrix.com">NZBMatrix</a><br/>
					<a href="http://www.newzbin.com/">Newzbin</a><br/>
				</div>

				<h1>Admin...</h1>
					<div id="admin">
					<a href="http://<?php echo $ip;?>:8080/">NAS Admin</a><br/>
					<a href="http://<?php echo $ip;?>:8085/sabnzbd/">SABnzbd</a><br/>
					<a href="http://<?php echo $ip;?>:49152">DLNA Server</a><br/>
					<a href="http://www.no-ip.com">NO-IP</a><br/>
				</div>
			</div>

		</div>
	</div>
	
	<div class="floatRight" style="width:700px">
  		<div class="sticker">
			<div class="stickerHeading" ><h1>SABnzdb</h1></div>
			<div class="content" id="sabnzdb"></div> 
		</div>
	</div>

	<!-- Still working on sickbeard and its API
	<div class="floatRight" style="width:700px">
  		<div class="sticker">
		<div class="stickerHeading" ><h1>SickBeard</h1></div>
		<div class="content" id="sickbeard">
			<table>
			<thead>
				<tr>
					<th>Result</th><th>Message</th><th>Show Name</th>
				</tr>
			</thead>
			<tbody data-bind="foreach: sickModel">
				<tr>
					<td data-bind="text: result"></td>
					<td data-bind="text: message"></td>
					<td data-bind="text: show_name"></td>
				</tr>    
			</tbody>
			</table>
		 </div> 
		</div>
	</div>
	-->

	<!-- 
		CoachPotato  in this iframe will need the JS hack. Please read /extra/couchpotato/readme.txt
	-->
	<div class="floatRight" style="width:700px">
  		<div class="sticker">
		<div class="stickerHeading" ><h1>CoachPotato</h1></div>
		 <div class="content" id="coachpotato">
			<iframe id="frame_coach" src="http://<?php echo $ip . ':' . $couch_port;?>/movie/" width="100%" height="<?php echo $couch_frame_height; ?>px" frameborder="0" scrolling="<?php echo $couch_frame_scroll; ?>" >Cannot load frame..</iframe>
			<div id="couchSnatched"></div>
			
		 </div> 
		</div>
	</div>
	
	
	<!-- NO API :( Need to figure something else out- will be similar to coachpotato though
	<div class="floatRight" style="width:700px">
  		<div class="sticker">
		<div class="stickerHeading" ><h1>Earphones</h1></div>
		<div class="content" id="earphones"></div> 
		</div>
	</div>
	-->
</div>

<script type="text/javascript">
	//Knockout engine
	//I will use knockout thorught out the project later on, with apps that support API's and JSON, isntead of including php files.
	//Commented out because i cant get it to work with the nested arrays that sickbeard returns..
	
	//function FreeDashViewModel() {
	//	var self = this;
		
		
	//	// Sickbeard Data
 	//	//self.sickModel = ko.mapping.fromJS(sickData);
	//	self.sickModel = ko.mapping.fromJS([  
	//											{ "result": "Standard (sandwich)", message: 0 },
	//											{ "result": "Premium (lobster)", message: 34.95 }
	//									  
	//										]);
	//}

	//ko.applyBindings(new FreeDashViewModel());		 
 	
</script>

</body>
<html>